package com.lsh.controller;

import com.lsh.service.ClientServer;
import com.lsh.util.ResultObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：LiuShihao
 * @date ：Created in 2021/3/8 1:35 下午
 * @desc ：服务调用端
 */
@RequestMapping("/client")
@RestController
public class ConsumerController {
    @Autowired
    ClientServer clientServer;

    @GetMapping("/findAll")
    public ResultObject findAll(){
        System.out.println("Client/findAll");
        return  new ResultObject("0000","查询成功",clientServer.findAll()) ;
    }
//    @GetMapping("/findById")
//    public ResultObject findById(Integer id){
//        System.out.println("Client/findById入参："+id);
//        return  new ResultObject("0000","查询成功",clientServer.findById(id)) ;
//    }
//
//    @PostMapping("/addUser")
//    public ResultObject addUser(@RequestBody User user){
//        System.out.println("Client/addUser入参："+user);
//        clientServer.addUser(user);
//        return new ResultObject("0000","添加成功",null);
//    }
//    @PutMapping("/updateUser")
//    public ResultObject updateUser(@RequestBody User user){
//        System.out.println("Client/updateUser入参："+user);
//        clientServer.updateUser(user);
//        return new ResultObject("0000","更新成功",null);
//    }
//    @DeleteMapping("/delUser")
//    public ResultObject delUser(int id){
//        System.out.println("Client/delUser入参："+id);
//        clientServer.delUser(id);
//        return new ResultObject("0000","删除成功",null);
//    }
}
